import unittest,time
from selenium import webdriver
from Page.Page1 import Page1
from Page.Page2 import Page2
from Page.Page3 import Page3
from Page.Page4 import Page4
from Page.Page5 import Page5
from Tools.Tools import Tools
from ddt import ddt,file_data

@ddt
class TestCase(unittest.TestCase):
    def setUp(self):
        Tools().Log()
        self.driver = webdriver.Edge()
        self.driver.maximize_window()

    def tearDown(self):
        time.sleep(3)
        self.driver.quit()

    @file_data(r'C:\Users\LENOVO\PycharmProjects\PythonProject\yuekao99\data.yaml')
    def test_A3mall_01_login(self,username,password):
        po = Page1(self.driver)
        po.luoji_A3mall_login(username,password)

    def test_A3mall_02_shopping(self):
        po = Page3(self.driver)
        po.luoji_A3mall_shopping()

    def test_A3mall_03_address(self):
        po = Page4(self.driver)
        po.luoji_A3mall_address()

    def test_A3mall_04_gwc(self):
        po = Page5(self.driver)
        po.luoji_A3amll_gwc()

if __name__ == '__main__':
    unittest.main()